<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>递归求和</title>
</head>
<body>
    <script>
       
        function gu(n){
            if(n==1)
            return 1;
            return n+gu(n-1);
        }
        alert(gu(100))
        function rui(){
           var s=0;
            for(var i=1;i<101;i++){
                s+=i;
            }
            // return s;
          console.log(s);
          console.log('s');
        }
        rui();
    
    </script>
</body>
</html>